package com.atguigu.tingshu.album.service;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface TrackInfoService extends IService<TrackInfo> {

    Page<TrackListVo> getUserTrackPage(Page<TrackListVo> pageInfo, TrackInfoQuery trackInfoQuery);

    void saveTrackInfo(TrackInfoVo trackInfo, Long userId);


    void removeTrackInfo(Long id);

    @Transactional(rollbackFor = Exception.class)
    void updateTrackInfo(TrackInfoVo trackInfoVo, Long id);

    void saveTrackStat(Long trackId, String statType, int statNum);

    IPage<AlbumTrackListVo> findAlbumTrackPage(IPage<AlbumTrackListVo> pageInfo, Long albumId, Long userId);

    void updateStat(TrackStatMqVo mqVo);

    TrackStatVo getTrackStatVo(Long trackId);

    List<TrackInfo> findWaitBuyTrackInfoList(Long userId, Long trackId, Integer trackCount);
}
